﻿<%@ Page Title="" MasterPageFile="~/BackOffice.master" Language="C#" AutoEventWireup="true" CodeBehind="CadastroFoto.aspx.cs" Inherits="JA.Web.Apresentacao.CadastroFoto" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<asp:Content ID="cHead" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="cMain" ContentPlaceHolderID="cphMain" runat="server">
    <div class="art-Block">
        <div class="art-Block-body">
            <div class="art-BlockHeader">
                <div class="l"></div>
                <div class="r"></div>
                <div class="art-header-tag-icon">
                    <div class="t">Cadastro de Foto de Im&oacute;veis</div>
                </div>
            </div>
            <div class="art-BlockContent">
                <div class="art-BlockContent-tl"></div>
                <div class="art-BlockContent-tr"></div>
                <div class="art-BlockContent-bl"></div>
                <div class="art-BlockContent-br"></div>
                <div class="art-BlockContent-tc"></div>
                <div class="art-BlockContent-bc"></div>
                <div class="art-BlockContent-cl"></div>
                <div class="art-BlockContent-cr"></div>
                <div class="art-BlockContent-cc"></div>
                <div class="art-BlockContent-body">

    
    <%-- asp:UpdatePanel ID="upnImovel" runat="server">
        <ContentTemplate --%>
            <asp:TabContainer ID="tabImovel" runat="server" ActiveTabIndex="0">

                <asp:TabPanel ID="tabPesquisa" runat="server" HeaderText="Pesquisa">
                    <ContentTemplate>
                        <div style="width: 98%;">
                            <table style="width: 100%;">
                                <tr>
                                    <td>
                                        C&oacute;digo
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtId" runat="server"></asp:TextBox>
                                        <asp:MaskedEditExtender ID="mskTxtId" runat="server" Mask="9999999" TargetControlID="txtId" PromptCharacter="" />
                                    </td>
                                    <td>
                                        Titulo
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTitulo" runat="server"></asp:TextBox>
                                    </td>
                                    <td>
                                        Cliente
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlCliente" runat="server" DataTextField="nome" DataValueField="idCliente"></asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Ativos?
                                    </td>
                                    <td>
                                        <asp:RadioButton ID="rbAtivoSim" runat="server" GroupName="Ativo" Text="Sim"/>
                                        <asp:RadioButton ID="rbAtivoNao" runat="server" GroupName="Ativo" Text="Não"/>
                                        <asp:RadioButton ID="rbAtivoNDA" runat="server" GroupName="Ativo" Text="NDA" Checked="true"/>
                                    </td>
                                    <td>
                                        Publicados?
                                    </td>
                                    <td>
                                        <asp:RadioButton ID="rbPublicoSim" runat="server" GroupName="Publico" Text="Sim"/>
                                        <asp:RadioButton ID="rbPublicoNao" runat="server" GroupName="Publico" Text="Não"/>
                                        <asp:RadioButton ID="rbPublicoNda" runat="server" GroupName="Publico" Text="NDA" Checked="true"/>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6">
                                        <asp:Button ID="btnPesquisa" runat="server" Text="Pesquisa" OnClick="btnPesquisa_Click" />
                                        <br />
                                        <br />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6">
                                        <asp:GridView ID="grvResultado" runat="server" AutoGenerateColumns="False" EmptyDataText="N&atilde;o foram encontrados registros nessa pesquisa!">
                                            <Columns>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="imgbVisualizar" runat="server" OnClick="imgbVisualizar_Click"
                                                            ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/editar.gif" CommandArgument='<%#Eval("IdImovel") %>' />
                                                    </ItemTemplate>
                                                    <ItemStyle HorizontalAlign="Center" />
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="IdImovel" HeaderText="ID" />
                                                <asp:BoundField DataField="Titulo" HeaderText="Titulo" />
                                                <asp:BoundField DataField="ClienteVO" HeaderText="Cliente" />
                                                <asp:BoundField DataField="Publicar" HeaderText="Publicado?" />
                                                <asp:BoundField DataField="Ativo" HeaderText="Ativo?" />
                                            </Columns>
                                        </asp:GridView>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </ContentTemplate>
                </asp:TabPanel>

                <asp:TabPanel ID="tabImagens" runat="server" HeaderText="Imagens">
                    <ContentTemplate>
                        <asp:Panel ID="panelFotos" runat="server">
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td colspan="2">
                                        Imagem : 
                                        <asp:FileUpload ID="FileUpload1" runat="server" Width="300" />&nbsp;
                                        <asp:Button ID="ButtonEnviar1" runat="server" Text="Enviar" OnClick="ProcessUpload" ValidationGroup="Salvar"/>
                                        <asp:ConfirmButtonExtender ID="ConfirmButtonExtender2" runat="server" TargetControlID="ButtonEnviar1" ConfirmText="Confirma o envio da imagem?">
                                        </asp:ConfirmButtonExtender>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" align="center">
                                        <asp:Label ID="LabelMensagem" runat="server" Text="" ForeColor="Red"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Imovel: <asp:TextBox ID="txtCadId" runat="server" Enabled="False"></asp:TextBox>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td valign="top">
                                        <asp:GridView ID="GridViewFotos" runat="server" AutoGenerateColumns="False" EmptyDataText="N&atilde;o foram encontrados registros nessa pesquisa!">
                                            <Columns>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="imgbVisualizarImg" runat="server" OnClick="imgbVisualizarImg_Click"
                                                            ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/editar.gif" CommandArgument='<%#Eval("IdImovelXFoto") %>' />
                                                    </ItemTemplate>
                                                    <ItemStyle HorizontalAlign="Center" />
                                                </asp:TemplateField>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="imgbRemoverImg" runat="server" OnClick="imgbRemoverImg_Click"
                                                            ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/excluir.gif" CommandArgument='<%#Eval("IdImovelXFoto") %>' />
                                                    </ItemTemplate>
                                                    <ItemStyle HorizontalAlign="Center" />
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="IdImovelXFoto" HeaderText="ID" />
                                                <asp:BoundField DataField="Arquivo" HeaderText="Arquivo" />
                                            </Columns>
                                        </asp:GridView>
                                    </td>
                                    <td valign="top">
                                        <asp:Image ID="Image1" runat="server" />
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:TabPanel>

            </asp:TabContainer>
        <%-- /ContentTemplate>
    </asp:UpdatePanel --%>


                </div>
            </div>
        </div>
    </div>


</asp:Content>




